<!DOCTYPE html>
<html>
<head>
    <style>
    body { margin: 0; width:100%%; height:100%%;  background-color:#000; }
    html { width:100%%; height:100%%; background-color:#000; }

    .embed-container iframe,
    .embed-container object,
    .embed-container embed {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%% !important;
        height: 100%% !important;
    }
    
    video::-webkit-media-controls { display: none !important }
    </style>
</head>
<body>
    <div class="embed-container">
        <video id="video" type="video/mp4" preload="auto" src="%@" webkit-playsinline></video>
    </div>
    <script>
    
    var video = document.getElementsByTagName('video')[0];
    video.addEventListener("playing", onPlaybackStart, false);
    video.addEventListener("ended", onPlaybackEnd, false);
    
    function onPlaybackStart() {
        window.location.href = 'instagramplayer://onPlayback?data=';
    }
    
    function onPlaybackEnd() {
        video.currentTime = 0;
        video.play();
    }
    
    function play() {
        video.play();
    }
    
    function pause() {
        video.pause();
    }

    video.play();
    
    </script>
</body>
</html>
